home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / bbs / MastErMind1_1.lha / MastE!rMind < prev    next >
Text File  |  1996-11-09  |  10KB  |  320 lines

  1. /*************************************************************************/
  2. /*           MastE!rMind v1.1 for Excelsior! BBS  by Morpheus            */
  3. /*************************************************************************/
  4. path='Doors:MastE!rMind/'
  5. /*************************************************************************/
  6. options results
  7. if ~open('HiScore',path||'MastE!rMind.data','R') then;do
  8. if ~open('HiScore',path||'MastE!rMind.data','W') then;do
  9. transmit 'Error: Could not create new highscore file!\w3'
  10. call quit_game
  11. end
  12. bbsidentify SYSOP
  13. sysop=result
  14. do i=1 for 10
  15. alias.i=sysop
  16. writeln('HiScore',alias.i)
  17. score.i=1100-(i*100)
  18. writeln('HiScore',score.i)
  19. end
  20. close('HiScore')
  21. end
  22. else;do
  23. do i=1 for 10
  24. alias.i=readln('HiScore')
  25. score.i=readln('HiScore')
  26. end
  27. close('HiScore')
  28. end
  29. quit=0
  30. call show_hiscore
  31. do forever
  32. call show_screen
  33. do i=1 for 4
  34. code.i=1+rnd(6)
  35. end
  36. time('R')
  37. move=1
  38. do while move<=10
  39. call get_invoer
  40. call check_invoer
  41. call show_hint(3+2*move)
  42. if zwart=4 then;do
  43. klok=time('E')
  44. klok=delstr(klok,length(klok)-2,3)
  45. call show_win
  46. move=10
  47. end
  48. move=move+1
  49. end
  50. if zwart~=4 then call show_lose
  51. end
  52. exit
  53. rnd:
  54. return (random(1,100,time(s))+random(1,100,time(s))+random(1,100,time(s)))//arg(1)
  55. show_screen:
  56. transmit '\f1\@6\n1    \c7ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿'
  57. transmit '    ³  \c6M a s t E ! r M i n d  \c7³'
  58. transmit '    ÃÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄ´       ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿'
  59. transmit '    ³  \c61 \c7³ \c6úúúú \c7³ ±± ±± ±± ±± ³       ³      \c6I n s t r u c t i o n s       \c7³'
  60. transmit '    ³    ÃÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄ´       ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´'
  61. transmit '    ³  \c62 \c7³ \c6úúúú \c7³ ±± ±± ±± ±± ³       ³  \c6Use cursor-keys to choose colour  \c7³'
  62. transmit '    ³    ÃÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄ´       ³                                    ³'
  63. transmit '    ³  \c63 \c7³ \c6úúúú \c7³ ±± ±± ±± ±± ³       ³ \c6Press <Enter> or <Space> to select \c7³'
  64. transmit '    ³    ÃÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄ´       ³                                    ³'
  65. transmit '    ³  \c64 \c7³ \c6úúúú \c7³ ±± ±± ±± ±± ³       ³ \c6Press <Del> or <Backspace> to undo \c7³'
  66. transmit '    ³    ÃÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄ´       ³                                    ³'
  67. transmit '    ³  \c65 \c7³ \c6úúúú \c7³ ±± ±± ±± ±± ³       ³     \c6Press <Q> or <Esc> to quit     \c7³'
  68. transmit '    ³    ÃÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄ´       ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´'
  69. transmit '    ³  \c66 \c7³ \c6úúúú \c7³ ±± ±± ±± ±± ³       ³  \c6+ ú right colour, right position  \c7³'
  70. transmit '    ³    ÃÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄ´       ³                                    ³'
  71. transmit '    ³  \c67 \c7³ \c6úúúú \c7³ ±± ±± ±± ±± ³       ³  \c6- ú right colour, wrong position  \c7³'
  72. transmit '    ³    ÃÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄ´       ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ'
  73. transmit '    ³  \c68 \c7³ \c6úúúú \c7³ ±± ±± ±± ±± ³'
  74. transmit '    ³    ÃÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄ´           ÚÄÄÄ¿ÚÄÄÄ¿ÚÄÄÄ¿ÚÄÄÄ¿ÚÄÄÄ¿ÚÄÄÄ¿'
  75. transmit '    ³  \c69 \c7³ \c6úúúú \c7³ ±± ±± ±± ±± ³           ³\c1ÛÛÛ\c7³³\c2ÛÛÛ\c7³³\c3ÛÛÛ\c7³³\c4ÛÛÛ\c7³³\c5ÛÛÛ\c7³³\c6ÛÛÛ\c7³'
  76. transmit '    ³    ÃÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄ´           ³\c1ÛÛÛ\c7³³\c2ÛÛÛ\c7³³\c3ÛÛÛ\c7³³\c4ÛÛÛ\c7³³\c5ÛÛÛ\c7³³\c6ÛÛÛ\c7³'
  77. transmit '    ³ \c610 \c7³ \c6úúúú \c7³ ±± ±± ±± ±± ³           ÀÄÄÄÙÀÄÄÄÙÀÄÄÄÙÀÄÄÄÙÀÄÄÄÙÀÄÄÄÙ'
  78. transmit '    ÃÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄ´'
  79. transmit '    ³  \c6Written by /Y\\orpheus  \c7³'
  80. transmit '    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ'
  81. return
  82. get_invoer:
  83. transmit put_cursor2(43,1)
  84. sendstring '30H'
  85. invoer.1=1
  86. i=1
  87. do while i<=5&quit=0
  88. call check_carrier
  89. getchar
  90. key=result
  91. if key='1B'x then;do
  92. checkio
  93. if result='TRUE' then;do
  94. getchar;getchar
  95. key=result
  96. if key='C' then key='6'
  97. if key='D' then key='4'
  98. end
  99. else quit=1
  100. end
  101. else if key='D'x|key='5'|key=' ' then key='0'
  102. select
  103. when upper(key)='Q' then quit=1
  104. when key='0'&i<=4 then;do
  105. k=i
  106. i=i+1
  107. invoer.i=invoer.k
  108. transmit put_colour(3+2*move,13+3*i,invoer.i)
  109. sendstring '30H'
  110. end
  111. when key='0'&i=5 then;do
  112. i=i+1
  113. sendstring '43H\c6                               '
  114. sendstring '30H'
  115. end
  116. when key='4'&i<=4 then;do
  117. transmit put_cursor1(38+5*invoer.i,invoer.i)
  118. if invoer.i=1 then invoer.i=6
  119. else invoer.i=invoer.i-1
  120. transmit put_cursor2(38+5*invoer.i,invoer.i)
  121. sendstring '30H'
  122. end
  123. when key='6'&i<=4 then;do
  124. transmit put_cursor1(38+5*invoer.i,invoer.i)
  125. if invoer.i=6 then invoer.i=1
  126. else invoer.i=invoer.i+1
  127. transmit put_cursor2(38+5*invoer.i,invoer.i)
  128. sendstring '30H'
  129. end
  130. when (key='08'x|key='7F'x)&i>1 then;do
  131. k=i
  132. i=i-1
  133. invoer.i=invoer.k
  134. transmit undo_colour(3+2*move,13+3*k)
  135. transmit put_cursor2(38+5*invoer.i,invoer.i)
  136. sendstring '43H\c6                               '
  137. sendstring '30H'
  138. end
  139. otherwise nop
  140. end
  141. if i=5 then;do
  142. transmit put_cursor1(38+5*invoer.i,invoer.i)
  143. sendstring '43H\c6Press <Enter> to end this move.'
  144. sendstring '30H'
  145. end
  146. end
  147. if quit=1 then;do
  148. transmit put_cursor1(38+5*invoer.i,invoer.i)
  149. call quit_game
  150. end
  151. return
  152. check_invoer:
  153. zwart=0;wit=0
  154. do i=1 for 4
  155. temp.i=code.i
  156. end
  157. do i=1 for 4
  158. if invoer.i=temp.i then;do
  159. zwart=zwart+1
  160. temp.i=0
  161. end
  162. end
  163. if zwart<4 then
  164. do i=1 for 4
  165. if temp.i~=0 then;do
  166. j=0
  167. do while j~=3
  168. idx=((i+j)//4)+1
  169. if invoer.i=temp.idx then;do
  170. wit=wit+1
  171. temp.idx=10
  172. j=3
  173. end
  174. else j=j+1
  175. end
  176. end
  177. end
  178. return
  179. show_hint:
  180. sendstring ''arg(1)';12H\c7'
  181. i=1
  182. do while i<=zwart
  183. sendstring '+'
  184. i=i+1
  185. end
  186. do while i<=(wit+zwart)
  187. sendstring '-'
  188. i=i+1
  189. end
  190. do while i<=4
  191. sendstring ' '
  192. i=i+1
  193. end
  194. sendstring '30H'
  195. return
  196. show_win:
  197. if klok<600 then score=(600-klok)*20
  198. else score=0
  199. score=score+(11-move)*1000
  200. sendstring '50H\c6Congratulations!'
  201. sendstring '45HYou have cracked the code!'
  202. sendstring '48HYour score is: '||score
  203. if score>score.10 then;do
  204. sendstring '48HYou have a high score!'
  205. sendstring '41HPress <Enter> to view high scores.'
  206. end
  207. else sendstring '41HPress <Enter> to start a new game.'
  208. sendstring '30H'
  209. call check_carrier
  210. getchar
  211. key=result
  212. if key='1B'x then;do
  213. checkio
  214. if result='TRUE' then;do
  215. getchar
  216. getchar
  217. end
  218. else call quit_game
  219. end
  220. else if upper(key)='Q' then call quit_game
  221. if score>score.10 then;do
  222. i=1
  223. do while i<=10
  224. if score>score.i then;do
  225. j=10
  226. do while j>i
  227. k=j-1
  228. score.j=score.k
  229. alias.j=alias.k
  230. j=j-1
  231. end
  232. score.i=score
  233. getuser 1
  234. alias.i=result
  235. i=10
  236. end
  237. i=i+1
  238. end
  239. if ~open('HiScore',path||'MastE!rMind.data','W') then;do
  240. transmit 'Error: Could not write to highscore file!\w3'
  241. call quit_game
  242. end
  243. do i=1 for 10
  244. writeln('HiScore',alias.i)
  245. writeln('HiScore',score.i)
  246. end
  247. close('HiScore')
  248. call show_hiscore
  249. end
  250. return
  251. show_lose:
  252. sendstring '41H\c6Sorry! You did not crack the code!'
  253. sendstring '42HThe correct code is: \c'code.1'ÛÛ \c'code.2'ÛÛ \c'code.3'ÛÛ \c'code.4'ÛÛ'
  254. sendstring '41H\c6Press <Enter> to start a new game.'
  255. sendstring '30H'
  256. call check_carrier
  257. getchar
  258. key=result
  259. if key='1B'x then;do
  260. checkio
  261. if result='TRUE' then;do
  262. getchar
  263. getchar
  264. end
  265. else call quit_game
  266. end
  267. else if upper(key)='Q' then call quit_game
  268. return
  269. quit_game:
  270. bbsidentify name
  271. bbsname=result
  272. sendstring '\f1\n3\c6'center('Returning to '||bbsname||'...',78)||'\n1\w3\q1'
  273. exit
  274. put_cursor1:
  275. return ''arg(1)'H\c7ÚÄÄÄ¿\<5\!1³\z'arg(2)'   \z0\c7³\<5\!1³\z'arg(2)'   \z0\c7³\<5\!1ÀÄÄÄÙ'
  276. put_cursor2:
  277. return ''arg(1)'H\c3ÉÍÍÍ»\<5\!1º\z'arg(2)'   \z0\c3º\<5\!1º\z'arg(2)'   \z0\c3º\<5\!1ÈÍÍͼ'
  278. put_colour:
  279. return ''arg(1)';'arg(2)'H\c'arg(3)'ÛÛ'
  280. undo_colour:
  281. return ''arg(1)';'arg(2)'H\c7±±'
  282. check_carrier:
  283. getcarrier
  284. if result='FALSE' then exit
  285. return
  286. show_hiscore:
  287. transmit '\f1\@6'
  288. transmit '  \c7ÛÛ\c4¿  \c7ÛÛ\c4¿ \c7ÛÛÛÛÛ\c4¿  \c7ÛÛÛÛÛ\c4¿ \c7ÛÛÛÛÛÛÛ\c4¿\c7ÛÛÛÛÛÛÛ\c4¿\c7ÛÛ\c4¿\c7ÛÛÛÛÛÛ\c4¿ \c7ÛÛ\c4¿  \c7ÛÛ\c4¿\c7ÛÛ\c4¿\c7ÛÛÛ\c4¿ \c7ÛÛ\c4¿\c7ÛÛÛÛÛÛ\c4¿'
  289. transmit '  \c7\z6²²²\c4\z0¿\c7\z6²²²\c4\z0³\c7\z6²²\c4\z0ÚÄÄ\c7\z6²²\c4\z0¿\c7\z6²²\c4\z0ÚÄÄÄÙ ÀÄ\c7\z6²²\c4\z0ÚÄÄÙ\c7\z6²²\c4\z0ÚÄÄÄÄÙ\c7\z6²²\c4\z0³\c7\z6²²\c4\z0ÚÄÄ\c7\z6²²\c4\z0¿\c7\z6²²²\c4\z0¿\c7\z6²²²\c4\z0³\c7\z6²²\c4\z0³\c7\z6²²²²\c4\z0¿\c7\z6²²\c4\z0³\c7\z6²²\c4\z0ÚÄÄ\c7\z6²²\c4\z0¿'
  290. transmit '  \c7\z6±±±±±±±\c4\z0³\c7\z6±±±±±±±\c4\z0³À\c7\z6±±±±±\c4\z0¿   \c7\z6±±\c4\z0³   \c7\z6±±±±±\c4\z0¿  \c7\z6±±\c4\z0³\c7\z6±±±±±±\c4\z0ÚÙ\c7\z6±±±±±±±\c4\z0³\c7\z6±±\c4\z0³\c7\z6±±\c4\z0Ú\c7\z6±±±±\c4\z0³\c7\z6±±\c4\z0³  \c7\z6±±\c4\z0³'
  291. transmit '  \c7\z6°°\c4\z0Ú\c7\z6°\c4\z0Ú\c7\z6°°\c4\z0³\c7\z6°°\c4\z0ÚÄÄ\c7\z6°°\c4\z0³ ÀÄÄÄ\c7\z6°°\c4\z0¿  \c7\z6°°\c4\z0³   \c7\z6°°\c4\z0ÚÄÄÙ  ÀÄÙ\c7\z6°°\c4\z0Ú\c7\z6°°\c4\z0ÚÙ \c7\z6°°\c4\z0Ú\c7\z6°\c4\z0Ú\c7\z6°°\c4\z0³\c7\z6°°\c4\z0³\c7\z6°°\c4\z0³À\c7\z6°°°\c4\z0³\c7\z6°°\c4\z0³  \c7\z6°°\c4\z0³'
  292. transmit '  \z6  \z0³ÀÙ\z6  \z0³\z6  \z0³  \z6  \z0³\z6      \z0ÚÙ  \z6  \z0³   \z6       \z0¿\z6  \z0¿\z6  \z0³À\z6  \z0¿ \z6  \z0³ÀÙ\z6  \z0³\z6  \z0³\z6  \z0³ À\z6  \z0³\z6      \z0ÚÙ'
  293. transmit '  ÀÄÙ  ÀÄÙÀÄÙ  ÀÄÙÀÄÄÄÄÄÙ   ÀÄÙ   ÀÄÄÄÄÄÄÙÀÄÙÀÄÙ ÀÄÙ ÀÄÙ  ÀÄÙÀÄÙÀÄÙ  ÀÄÙÀÄÄÄÄÄÙ\n1'
  294. transmit copies(' ',22)||'\c6É\c7Í'||copies('\c6Í\c7Í',16)||'\c6»'
  295. transmit copies(' ',22)||'\c7º                                 º'
  296. transmit copies(' ',22)||'\c6º           H\c7i\c6g\c7h \c6S\c7c\c6o\c7r\c6e\c7s           \c6º'
  297. transmit copies(' ',22)||'\c7º                                 º'
  298. transmit copies(' ',22)||'\c6Ì\c7Í'||copies('\c6Í\c7Í',16)||'\c6¹'
  299. transmit copies(' ',22)||'\c7º                                 º'
  300. do i=1 for 10
  301. if i//2 then kleur='\c6'
  302. else kleur='\c7'
  303. transmit copies(' ',22)||kleur||'º\c1'||right(i,3)||'. \c3'||left(alias.i,21,'.')||'\c2'||right(score.i,6)||kleur||' º'
  304. end
  305. transmit copies(' ',22)||'\c6º                                 º'
  306. transmit copies(' ',22)||'\c7È\c6Í'||copies('\c7Í\c6Í',16)||'\c7¼'
  307. sendstring '\n1\c6'copies(' ',27)||'Press <Enter> to continue '
  308. call check_carrier
  309. getchar
  310. key=result
  311. if key='1B'x then;do
  312. checkio
  313. if result='TRUE' then;do
  314. getchar
  315. getchar
  316. end
  317. else call quit_game
  318. end
  319. else if upper(key)='Q' then call quit_game
  320. return